package com.imooc.configuration;

import com.imooc.bean.Bean1;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ComponentScans;
import org.springframework.context.annotation.Configuration;

/**
 * xml格式也可实现包扫描,见Class12的xml
 * 包扫描模式,无法使用别称
 */
@Configuration
@ComponentScan(basePackages = "com.imooc")
public class MyConfiguration {
    //别名只有这一种取名方式
//    @Bean(value = {"bean1","bean2"})
//    public Bean1 bean1(){
//        return new Bean1();
//    }
}
